package com.youlu.campus.admin.community.controller;

import com.youlu.campus.entity.ActivitySubscribeAppId;
import com.youlu.campus.entity.VO.req.ActivitySubscribeAppIdQueryVO;
import com.youlu.campus.service.activity.ActivitySubscribeAppIdService;
import com.yuelin.infrastructure.quantum.common.QResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.constraints.NotNull;

@RestController
public class ActivitySubscribeAppIdController {
    @Autowired
    private ActivitySubscribeAppIdService activitySubscribeAppIdService;

    @PostMapping("/activity/subscribe-app/list")
    public QResult list(@RequestBody @NotNull ActivitySubscribeAppIdQueryVO req) {
        return QResult.success(activitySubscribeAppIdService.list(req));
    }

    @PostMapping("/activity/subscribe-app/create")
    public QResult create(@RequestBody @NotNull ActivitySubscribeAppId req) {
        return QResult.success(activitySubscribeAppIdService.create(req));
    }

    @PostMapping("/activity/subscribe-app/update")
    public QResult update(@RequestBody @NotNull ActivitySubscribeAppId req) {
        return QResult.success(activitySubscribeAppIdService.update(req));
    }

    @GetMapping("/activity/subscribe-app/delete")
    public QResult delete(@RequestParam("id") String id) {
        return QResult.success(activitySubscribeAppIdService.delete(id));
    }
}
